import React, { Component } from 'react';
import { Modal } from 'antd';

class ShowMessageList extends Component {
  render() {
    const { dataL } = this.props;
    return (
      <p>
        {dataL[0]}:{dataL[1]}
      </p>
    );
  }
}

class ShowMessage extends Component {
  render() {
    const { visible, onCancel, showmessage } = this.props;
    var arr = [];
    for (var attr in showmessage) {
      if (showmessage.hasOwnProperty(attr)) {
        arr.push([attr, showmessage[attr]]);
      }
    }
    let list = arr.map((e, i) => {
      return <ShowMessageList key={i} dataL={e} />;
    });

    return (
      <Modal
        className="detailclosekeymanagement"
        visible={visible}
        closable={false}
        okText="确认"
        onCancel={onCancel}
        onOk={onCancel}
        title="信息"
      >
        <div>{list}</div>
      </Modal>
    );
  }
}
export default ShowMessage;
